Skip to content

Add CI workflow to lint and check formatting of Go code #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 14, 2022
Merged

Add CI workflow to lint and check formatting of Go code #23

merged 5 commits into from
Sep 14, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Sep 14, 2022

Tasks and a GitHub Actions workflow are provided here to check for problems with the project's Go code.

On every push and pull request that affects relevant files, check the repository's Go module for:

  • Common detectable errors in the code.
  • Use of outdated APIs
  • Code style violations
  • Code formatting inconsistency
  • Misconfiguration

In order to enable the use of this and other infrastructure, I migrated the project to using the Go modules framework.

I resolved the violations of golint rules that were revealed by the addition of the check system

This will allow the use of modern Go dependency management and project management capabilities.
On every push and pull request that affects relevant files, check the Go module for:

- Common detectable errors in the code.
- Use of outdated APIs
- Code style violations
- Code formatting inconsistency
- Misconfiguration
golint imposes the important requirement that all exported API components have a doc comment.

From a purely technical sense, there is no reason for the developer to have exported AppVersion, since it is not used in
other packages of the project and the project is exclusively a standalone application; not a reusable package.

However, there is maybe a little bit of semantic sense to exporting AppVersion. The deploy.sh script uses this line of
the code, so in a way it is "exported", even though it is used in an janky manner that does not care anything about Go's
export framework.

So the export may communicate that this line is an "API" of sorts and that modifying it must be done with care.
Since the developer did not bother to provide any documentation, it is not clear what purpose this thing was intended to
serve. What is clear is that it does not serve any purpose now, so it must be removed.
This project is intended only as a standalone application; not as a reusable packge. It only has a single package. For
this reason, there is no reason to export functions.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Sep 14, 2022
@per1234 per1234 self-assigned this Sep 14, 2022
Copy link
Contributor

@MatteoPologruto MatteoPologruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Per!

@per1234 per1234 merged commit 2f7a0d0 into arduino:master Sep 14, 2022
@per1234 per1234 deleted the module branch September 14, 2022 08:26
@per1234 per1234 linked an issue Sep 15, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bring CI up to tooling standard for the arduinoOTA repo
2 participants